<?php

/**
 * images actions.
 *
 * @package    berta-s
 * @subpackage images
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class imagesActions extends sfActions {
	public function executeIndex(sfWebRequest $request){
		if ($request->hasParameter("entry_image")){
			$imagesValues=$request->getParameter("entry_image");
		}
		$this->forward404If(empty($imagesValues["entry_id"]), "No Entry Id!");
		$this->entry=
			Doctrine::getTable("Entry")
			->createQuery()
			->addWhere("id = ?", $imagesValues["entry_id"])
			->fetchOne();

		$this->forward404If(empty($this->entry), "No such Entry!");

#		$this->images=$this->getRoute()->getObjects();
		$this->images=
			Doctrine::getTable("EntryImage")
			->retrieveListByEntryIdForBackend($imagesValues["entry_id"]);


		$this->width=$this->height=null;
		if ($request->hasParameter("type")){
			$values=explode("x", $request->getParameter("type"));

			$this->width=$values[0];
			if (!empty($values[1])){
				$this->height=$values[1];
			}
		}


	}



}